#include <iostream>
using namespace std;

class Cube
{
public:
  void setL(int L)
  {
    if (L <= 0)
    {
      cout << "请输入正确的长度" << endl;
      return;
    }

    m_L = L;
  }

  int getL()
  {
    return m_L;
  }

  void setW(int W)
  {
    if (W <= 0)
    {
      cout << "请输入正确的长度" << endl;
      return;
    }

    m_W = W;
  }

  int getW()
  {
    return m_W;
  }

  void setH(int H)
  {
    if (H <= 0)
    {
      cout << "请输入正确的长度" << endl;
      return;
    }

    m_H = H;
  }

  int getH()
  {
    return m_H;
  }

  int getArea()
  {
    return m_L * m_W * 2 + m_L * m_H * 2 + m_W * m_H * 2;
  }

  int getV()
  {
    return m_L * m_W * m_H;
  }

  bool isSame(Cube &c2)
  {
    if (m_L == c2.getL() && m_W == c2.getW() && m_H == c2.getH())
    {
      return true;
    }
    return false;
  }

private:
  int m_L;
  int m_W;
  int m_H;
};

bool isSame(Cube &c1, Cube &c2)
{
  if (c1.getL() == c2.getL() && c1.getW() == c2.getW() && c1.getH() == c2.getH())
  {
    return true;
  }
  return false;
}

int main(int argc, char const *argv[])
{

  Cube c1;
  c1.setL(10);
  c1.setW(10);
  c1.setH(10);

  cout << "c1的面积为：" << c1.getArea() << "\tc1的体积为：" << c1.getV() << endl;

  Cube c2;
  c2.setL(10);
  c2.setW(10);
  c2.setH(10);

  cout << "c1的面积为：" << c2.getArea() << "\tc1的体积为：" << c2.getV() << endl;

  // bool ret = isSame(c1, c2);
  bool ret = c1.isSame(c2);

  if (ret)
  {
    cout << "c1和c2是相等的" << endl;
  }
  else
  {
    cout << "c1和c2是不相等的" << endl;
  }

  return 0;
}